<?php
error_reporting(-1);
$thispage = $_SERVER["PHP_SELF"];
 
$MEMBER=false;
$ADMIN=false;
$myid=0;
$myname="";
$myemail="";
if (isset($_SESSION['user_id'])) {
	$myid = $_SESSION['user_id'];
	$MEMBER = true;
	if (isset($_SESSION['user_right'])) {
		if ($_SESSION['user_right']=="admin") {
			$ADMIN = true;
		}
	}
}
if (isset($_SESSION['user_email'])) {
	$myemail=$_SESSION['user_email'];
}
if (isset($_SESSION['user_name'])){
	$myname=$_SESSION['user_name'];
}

date_default_timezone_set("Asia/Ho_Chi_Minh");
function redirect($location, $delaytime = 0) {
    if ($delaytime>0) {    
        header( "refresh: $delaytime; url='".str_replace("&amp;", "&", $location)."'" );
    } else {
        header("Location: ".str_replace("&amp;", "&", $location));
    }    
}

?>
